import request from '@/utils/request'

export function createCourse(data) {
  return request({
    url: 'manager/course/create',
    method: 'post',
    data
  })
}

export function updateCourse(data) {
  return request({
    url: 'manager/course/update',
    method: 'post',
    data
  })
}

export function uploadCourse(data) {
  return request({
    url: 'manager/course/upload',
    method: 'post',
    data
  })
}

// 班级列表
export function deleteCourse(data) {
  return request({
    url: 'manager/course/delete',
    method: 'post',
    data
  })
}

export function openCourse(data) {
  return request({
    url: 'manager/course/open',
    method: 'post',
    data
  })
}

export function setCourseOrder(data) {
  return request({
    url: 'manager/course/order',
    method: 'post',
    data
  })
}

// 班级列表
export function fetchCourseList(query) {
  return request({
    url: 'manager/course/list',
    method: 'get',
    params: query
  })
}
